<template>
    <div>
        <h3>机构修改</h3>
        
        <table class="table table-bordered">
            <tbdoy>
                <tr>
                    <td>机构名称</td>
                    <td>
                        {{ tian.jgname }}
                    </td>
                </tr>
                <tr>
                    <td>机构封面</td>
                    <td>
                        <img :src="tian.tu" width="100" height="100" alt="" v-if="tian.tu !=''">
                    </td>
                </tr>
                <tr>
                    <td>特色服务</td>
                    <td>
                        <span v-if="tian.xiala==1">黑丝</span>
                        <span v-if="tian.xiala==2">白丝</span>
                        <span v-if="tian.xiala==3">肉丝</span>
                        <span v-if="tian.xiala==4">马油袜</span>
                        <span v-if="tian.xiala==5">渔网袜</span>
                        <span v-if="tian.xiala==6">金黄色的规范化的</span>
                    </td>
                </tr>
                <tr>
                    <td>营业时间</td>
                    <td>
                        {{tian.yingye }}
                    </td>
                </tr>
                <tr>
                    <td>机构地址</td>
                    <td>
                        {{ tian.dizhi }}
                    </td>
                </tr>
                <tr>
                    <td>联系电话</td>
                    <td>
                        {{ tian.phone }}
                    </td>
                </tr>
                <tr>
                    <td>发布状态</td>
                    <td>
                        {{ tian.steat==1?"已发布":"未发布" }}
                    </td>
                </tr>
                <tr>
                    <td>发布详情</td>
                    <td>
                        {{ tian.xiangq }}
                    </td>
                </tr>
                
            </tbdoy>
        </table>
        <!-- 考试结束 -->
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import {ref,reactive, onMounted} from 'vue'
import {useRoute,useRouter} from 'vue-router'
const route=useRoute();
const router=useRouter();
let tian:any=reactive({
    id:route.query.id,
    jgname: '',
    tu: '',
    xiala:'',
    yingye: '',
    dizhi: '',
    phone: '',
    steat: '',
    xiangq: '',
 
})
const img=(e:any)=>{
    let obj=e.target.files[0];
    let f=new FormData();
    f.append('file',obj);
    axios({
        url:'/api/img/tu',
        method:'post',
        data:f
    })
    .then((res)=>{
        console.log(res);
        tian.tu=res.data;
    })
    .catch((err)=>{
        console.log(err);
    })
}
const data:any=reactive({
    list:[]

})
onMounted(()=>{

    fantian();
})
const fantian=()=>{
    axios({
        url:'/api/jg/fantian',
        method:'get',
        params:{
            id:route.query.id
        }
    })
    .then((res)=>{
        console.log(res);
        tian.jgname=res.data.jgname
        tian.tu=res.data.tu
        tian.xiala=res.data.xiala
        tian.yingye=res.data.yingye
        tian.dizhi=res.data.dizhi
        tian.phone=res.data.phone
        tian.steat=res.data.steat
        tian.xiangq=res.data.xiangq
  
    })
    .catch((err)=>{
        console.log(err);
    })
}


</script>

<style scoped>

</style>